<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: YANG
  Date: 2023/3/20
  Time: 9:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员权限</title>
    <script src="<%=request.getContextPath()%>/js/jquery-1.8.3.min.js"></script>
<%--    <script src="<%=request.getContextPath()%>/js/redactVerify.js"></script>--%>
    <link href="<%=request.getContextPath()%>/css/orderForm.css" type="text/css" rel="stylesheet">
</head>
<body>
<div class="centre_div">
    <div class="top_menu">
        <ul class="top_menu_ul">
            <li>
                <p><span class="menu_sp">Hotel Meigetsu </span>后台管理系统</p>
            </li>
            <li>
                <a href="#">客服中心</a>
            </li>
        </ul>
    </div>
    <div class="left_menu">
        <ul>
            <%--有权限--%>
            <c:if test="${administrator.memberJurisdiction > 0}">
                <li><a href="<%=request.getContextPath()%>/memberjsp/login.jsp">会员管理</a></li>
            </c:if>
            <c:if test="${administrator.memberJurisdiction == 0}">
                <li><a href="#" class="logs">会员管理</a></li>
            </c:if>
            <%--            //公开权限--%>
            <li><a href="<%=request.getContextPath()%>/cims.do?type=inquire">客户管理</a></li>
            <%--            //公开权限--%>
            <li><a href="<%=request.getContextPath()%>/orderForm?type=seek">订单管理</a></li>
            <%--            //公开权限--%>
            <li><a href="<%=request.getContextPath()%>/houseTypeWork">房型管理</a></li>
            <%--            //公开权限--%>
            <li><a href="<%=request.getContextPath()%>/keeper?type=inquire">房间管理</a></li>
            <%--有权限--%>
            <c:if test="${administrator.doBusinessJurisdiction > 0}">
                <li><a href="#">营业统计</a></li>
            </c:if>
            <c:if test="${administrator.doBusinessJurisdiction == 0}">
                <li><a href="#">营业统计</a></li>
            </c:if>
            <%--有权限--%>
            <c:if test="${administrator.financeJurisdiction > 0}">
                <li><a href="#">财务报表</a></li>
            </c:if>
            <c:if test="${administrator.financeJurisdiction == 0}">
                <li><a href="#">财务报表</a></li>
            </c:if>
            <%--有权限--%>
            <c:if test="${administrator.logJurisdiction > 0}">
                <li><a href="<%=request.getContextPath()%>/log?type=inquiryLog">日志管理</a></li>
            </c:if>
            <c:if test="${administrator.logJurisdiction == 0}">
                <li><a href="#" class="logs">日志管理</a></li>
            </c:if>
            <%--有权限--%>
            <c:if test="${administrator.manageJurisdiction > 0}">
                <li><a href="<%=request.getContextPath()%>/administrator?type=inquire">管理权限</a></li>
            </c:if>
            <c:if test="${administrator.manageJurisdiction == 0}">
                <li><a href="#" class="logs">管理权限</a></li>
            </c:if>
            <script>
                $(function (){
                    $(".logs").click(function (){
                        alert("您暂时没有权限，请联系上级开通权限");
                    })
                })
            </script>
        </ul>
    </div>
    <div class="head_div">
        <div class="bjtp">
        </div>
        <div id="greet_div">
            <p>Hotel Meigetsu</p>
        </div>
        <div id="customer_form">
            <div class="top_center">
                <form action="<%=request.getContextPath()%>/administrator?type=inquire" method="get">
                    <span>管理员编号：</span><input type="text" name="names" class="top_center_input">
                    <input type="submit" value="查询" class="top_center_submit">
                    <a href="<%=request.getContextPath()%>/administrator?type=add">添加管理员</a>
                </form>
            </div>
            <div class="center_menu">
                <table class="menu_table" border="1" cellpadding="0" cellspacing="0" bordercolor="#F1F1F1">
                    <tr class="head_tr">
                        <td>序号</td>
                        <td>管理员编号</td>
                        <td>管理员密码</td>
                        <td>会员权限</td>
                        <td>营业权限</td>
                        <td>酒店物品权限</td>
                        <td>管理员权限</td>
                        <td>日志权限</td>
                        <td>财务权限</td>
                        <td>更多</td>
                    </tr>
                   <c:forEach items="${administratorList}" var="administratorList" varStatus="status">
                       <tr>
                           <td>${status.index + 1}</td>
                           <td>${administratorList.administratorNumber}</td>
                           <td>${administratorList.password}</td>
                           <td>${administratorList.memberJurisdiction}</td>
                           <td>${administratorList.doBusinessJurisdiction}</td>
                           <td>${administratorList.goodsJurisdiction}</td>
                           <td>${administratorList.manageJurisdiction}</td>
                           <td>${administratorList.logJurisdiction}</td>
                           <td>${administratorList.financeJurisdiction}</td>
                           <td>
                               <a href="<%=request.getContextPath()%>/administrator?type=alter&name=${administratorList.administratorNumber}">修改权限</a>&nbsp;|&nbsp;
                               <a href="<%=request.getContextPath()%>/administrator?type=delete&name=${administratorList.administratorNumber}">删除</a>
                           </td>
                       </tr>
                   </c:forEach>
                </table>
            </div>
        </div>
    </div>
</div>
</body>
</html>
